/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SMeterInputConverter.java
 * Created：		2016年8月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.common;

import org.springframework.core.convert.converter.Converter;

import com.thor.commons.entity.Operator;
import com.thor.palmmall.spi.common.SOperator;

/**
 * @author wolv
 *
 */
public class OperatorConverter implements Converter<SOperator, Operator> {

	public static OperatorConverter getInstance() {
		if (instance == null)
			instance = new OperatorConverter();
		return instance;
	}

	private static OperatorConverter instance;

	private OperatorConverter() {
	}

	@Override
	public Operator convert(SOperator source) {
		if (source == null)
			return null;

		Operator target = new Operator();
		target.setId(source.getId());
		target.setOperName(source.getFullName());

		return target;
	}

}
